﻿<phone:PhoneApplicationPage
    x:Class="Animation.WP8.IntroductionPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:bam="clr-namespace:Brain.Animate;assembly=AnimationManager.WP8"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
	Foreground="{StaticResource DarkGreyBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="False">


    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="{StaticResource YellowBrush}" >
        
        <bam:AnimationTrigger.Open>
            <bam:FadeInAnimation/>
        </bam:AnimationTrigger.Open>
        <bam:AnimationTrigger.Close>
            <bam:FadeOutAnimation Duration="1.0" />
        </bam:AnimationTrigger.Close>
        
        
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.RowSpan="2" >
            <bam:AnimatedImage x:Name="AnimatedImage" 
                Width="150" Height="150" 
                SpriteWidth="82" SpriteHeight="150" 
                SpriteSheetSource="/Images/WalkingSpriteSheet.png" 
                SpriteCountX="8" SpriteIndex="0" 
                FrameTimeSpan="00:00:00.2" IsAnimating="True" >
                
                <bam:AnimationTrigger.Open>
                    <bam:FadeInRightAnimation Delay="0.6" Duration="1.0"/>
                </bam:AnimationTrigger.Open>
                <bam:AnimationTrigger.Close>
                    <bam:LightSpeedOutRightAnimation Duration="1.5"/>
                </bam:AnimationTrigger.Close>

            </bam:AnimatedImage>

            <TextBlock x:Name="pageTitle" Text="Animation Manager" 
                       Style="{StaticResource PhoneTextExtraLargeStyle}" Foreground="{StaticResource OrangeBrush}" >
                <bam:AnimationTrigger.Open>
                    <bam:BounceInDownAnimation/>
                </bam:AnimationTrigger.Open>
                <bam:AnimationTrigger.Close>
                    <bam:BounceOutUpAnimation/>
                </bam:AnimationTrigger.Close>
            </TextBlock>

            <Button x:Name="ShowcaseButton" Content="showcase" 
                    Style="{StaticResource IntroductionButtonStyle}"
                    Margin="0,25,0,0" 
                    Click="ShowcaseButton_OnClick" >
                <bam:AnimationTrigger.Open>
                    <bam:BounceInUpAnimation Delay="0.3"/>
                </bam:AnimationTrigger.Open>
                <bam:AnimationTrigger.Idle>
                    <bam:PulseAnimation Duration="4.0"/>
                </bam:AnimationTrigger.Idle>
            </Button>

            <Button x:Name="NavigationButton" Content="navigation" 
                    Style="{StaticResource IntroductionButtonStyle}"
                    Click="NavigationButton_OnClick" >
                <bam:AnimationTrigger.Open>
                    <bam:BounceInUpAnimation Delay="0.4"/>
                </bam:AnimationTrigger.Open>
            </Button>

            <Button x:Name="ExperimentsButton" Content="experiments"
                    Style="{StaticResource IntroductionButtonStyle}"
                    Click="ExperimentsButton_OnClick">
                <bam:AnimationTrigger.Open>
                    <bam:BounceInUpAnimation Delay="0.5"/>
                </bam:AnimationTrigger.Open>
            </Button>
        </StackPanel>
        <TextBlock Text="Sponsored by: BrainOffline" 
                   x:Name="SponsorText" Grid.Row="1"
                   HorizontalAlignment="Center" VerticalAlignment="Bottom" 
                   Style="{StaticResource PhoneTextAccentStyle}" Margin="12" 
                   Foreground="{StaticResource RedBrush}"
                   >
            <bam:AnimationTrigger.Open>
                <bam:LightSpeedInRightAnimation Delay="0.6"/>
            </bam:AnimationTrigger.Open>
            <bam:AnimationTrigger.Idle>
                <bam:FloatAnimation Distance="-20" Duration="1.5"/>
            </bam:AnimationTrigger.Idle>
        </TextBlock>
    </Grid>

</phone:PhoneApplicationPage>